<%@ page contentType="application/xhtml+xml;charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>

<jsp:useBean id="data" scope="page"
             class="cz.muni.fi.xvano1.trinity.supplementary.DataSupplier"/>

<stripes:form beanclass="cz.muni.fi.xvano1.trinity.beans.EditEventActionBean">
    <c:out value="Please insert event parameters."/><br/><br/>
    <c:out value="Quick description: "/><stripes:text name="summary" value="${summary}"/><br/>
    <c:out value="Start of event: "/><stripes:text name="start" value="${start}"/><br/>
    <c:out value="End of event: "/><stripes:text name="end" value="${end}"/><br/>
    <c:out value="Recurrence: "/>
    <stripes:select name="recurrence">
        <stripes:option value="">Select new type</stripes:option>
        <stripes:options-collection collection="${data.recurrences}"
                                    label="name" value="name"/>
    </stripes:select><br/>
    <c:out value="Re-mark as one-day event? "/><stripes:checkbox  name="wholeDay" checked="${wholeDay}"/><br/>
    <c:out value="Location: "/>
    <stripes:select name="location">
        <stripes:option value="">Please select location</stripes:option>
        <stripes:options-collection collection="${locations}"/>
    </stripes:select><br/>
    <stripes:hidden name="uid" value="${uid}"/>
    <stripes:submit name ="editEventConfirm" value="Submit"/>
    <stripes:reset  name="Reset"/>
    
    <table border="2">
    <thead>
        <tr>
            <th>
                <c:out value="Toolbox"/>
            </th>
            <th>
                <c:out value="Count"/>
            </th>
        </tr>
    </thead>
    <tbody>
        <c:forEach items="${allowedKeys}" var="key">
            <tr>     
                <td>
                    ${key}
                </td>
                <td>                  
                    <stripes:text name="${key}" value="${request[key]}"/>
                </td>
            </tr>
        </c:forEach>
    </tbody>
</table>
</stripes:form>